package net.wanglu.www.zzz.service.se;

import java.util.HashMap;
import java.util.Map;

import net.wanglu.www.zzz.service._Service;

public class __SentenceExtracter extends _Service {

	__SeExtracterManager extracterManager = null;
	
	public __SeExtracterManager getExtracterManager() {
		return extracterManager;
	}
	public void setExtracterManager(__SeExtracterManager extracterManager) {
		this.extracterManager = extracterManager;
	}

	@Override
	public Object service(Object... objects) throws Exception {
		// TODO Auto-generated method stub
		HashMap<?, ?> preprocessData = (HashMap<?, ?>) objects[0];
		__SentenceElements se = null;
		if ( objects.length >1) {
			se = (__SentenceElements) objects[1];
		} else {
			se = new __SentenceElements();
		}
		
		HashMap<String, _Service> extracters = this.extracterManager.getExtracters();
		for( Map.Entry<String, _Service> entry : extracters.entrySet()) {
			se = (__SentenceElements) entry.getValue().service(preprocessData, se);
		}
		return se;
	}
}
